Skip to content

Conversation

kylebarron
Copy link
Contributor

@kylebarron kylebarron commented Aug 22, 2024

Pandas added support for the Arrow PyCapsule Interface (the __arrow_c_stream__ method) in pandas v2.2. pandas-dev/pandas#56587

This method returns a C PyCapsule, so it's not the types of arguments or return value that matters, it's really just the existence of the method, so that when other libraries expect an object defined as

class ArrowStreamExportable(Protocol):
    def __arrow_c_stream__(
        self,
        requested_schema: object | None = None
    ) -> object:
        ...

then a DataFrame will satisfy the type checker

  • Closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added: Please use assert_type() to assert the type of any return value

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kylebarron

I'm not sure we would have ever picked this up, because it isn't documented in the pandas release notes.

@Dr-Irv Dr-Irv merged commit d2798db into pandas-dev:main Aug 26, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants